<%@page contentType="text/html" pageEncoding="UTF-8" import="java.io.*, java.sql.*, javax.sql.*"%>
<%

    Connection con = com.elookinto.wordlist.Util.getCon();
    String listName = request.getParameter("listName");
    String uid = (String) session.getAttribute("uid");
    if (listName == null || uid == null) {
        return;
    }

    PreparedStatement st = null;

    st = con.prepareStatement("Select distinct word, listname  from wordlist where listname=? and uid=?");
    st.setString(1, listName);
    st.setString(2, uid);

    ResultSet rs = st.executeQuery();
    while (rs.next()) {
        String word = rs.getString("word");
        out.print(word + " ");
    }

    rs.close();
    st.close();
    con.close();
%>
